package lancooPaperAnswer;

import android.content.Context;
import android.text.Editable;
import android.text.Html;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.hyznbk.R;
import com.example.hyznbk.presenter.PaperDef;

import org.apache.commons.lang3.StringEscapeUtils;

import lancooControl.Control;
import lancooControl.CustomEditText;

import static android.view.View.GONE;
import static testPaperCTCS.GuessTestingPaperActivity.InforGuessTesting;
import static testPaperFavoritesPage.FavoritesPagePaperActivity.InforFavoritesPage;
import static testPaperJBFX.BasicReviewPaperActivity.InforBasicReview;
import static testPaperNDFX.DifficultReviewPaperActivity.InforDifficultReview;
import static testPaperWrong.WrongQuesPaperActivity.InforWrongQues;
import static testPaperWrongHistory.HistoryWrongQuesPaperActivity.InforHistoryWrongQues;


/**
 * Created by Administrator on 2017/4/5.
 */
public class AnswerYdjdAdapter extends BaseAdapter

{

    private LayoutInflater mInflater;
    private Context mContext;
    //当前试题数量
    private int SumItem;
    //当前试题在当前试卷的ID
    private int PaperID;
    //当前问题小题所在大题的ID
    private int OptionID;
    private int ModelFrom;//试卷来源

    private int tvBlack;
    private int tvBlue;
    private int tvWhite;
    private int tvGreen;
    private int tvRed;


    private ViewHolder holder = null;
    private class ViewHolder {
//        TextView TvItemIndex;//小题编号
        TextView TvItemContent;//大题文本题干区
        CustomEditText EdtAnswer;//作文输入区
        LinearLayout LayoutAnalysis;//答案回看解析区
        TextView TvStuAnswer;//我的答案
        TextView TvAnswer;//参考答案
        TextView TvScore;//得分
        TextView TvAnalysis;//解析
        TextView TvStuAssess;//自评
        LinearLayout LayoutScore;//回看得分
        TextView TvAnswerAmount;//小题总数

        LinearLayout LayoutClassicExample;//经典案例显示区
        LinearLayout LayoutClassicMenu;//参考答案及解析按钮
        ImageView IvClassic;//参考答案及解析箭头
        LinearLayout LayoutClassic;//参考答案及解析显示区
        TextView TvClassicAnswer;//参考答案
        TextView TvClassicAnalysis;//解析
        private ViewHolder(View convertView) {
//            TvItemIndex = (TextView) convertView.findViewById(R.id.tv_item_index);
            TvItemContent = (TextView) convertView.findViewById(R.id.tv_item_content);
            EdtAnswer = (CustomEditText) convertView.findViewById(R.id.edt_answer);
            LayoutAnalysis = (LinearLayout) convertView.findViewById(R.id.layout_analysis);
            TvStuAnswer = (TextView) convertView.findViewById(R.id.tv_stu_answer);
            TvAnswer = (TextView) convertView.findViewById(R.id.tv_answer);
            TvScore = (TextView) convertView.findViewById(R.id.tv_score);
            TvAnalysis = (TextView) convertView.findViewById(R.id.tv_analysis);
            TvStuAssess = (TextView) convertView.findViewById(R.id.tv_stu_assess);
            LayoutScore = (LinearLayout) convertView.findViewById(R.id.layout_score);
            TvAnswerAmount = (TextView) convertView.findViewById(R.id.tv_answer_amount);

            LayoutClassicExample = (LinearLayout) convertView.findViewById(R.id.layout_classic_example);
            LayoutClassicMenu = (LinearLayout) convertView.findViewById(R.id.layout_classic_menu);
            LayoutClassicMenu.setOnClickListener(new clickListener());
            IvClassic = (ImageView) convertView.findViewById(R.id.iv_classic);
            LayoutClassic = (LinearLayout) convertView.findViewById(R.id.layout_classic);
            TvClassicAnswer = (TextView) convertView.findViewById(R.id.tv_classic_answer);
            TvClassicAnalysis = (TextView) convertView.findViewById(R.id.tv_classic_analysis);

        }
    }

    /*
   * 获取小题选项信息
   * */
    private int itemIndex ;//小题编号
    private String itemContent;//题干信息
    private String quesImage ;//题干图片信息
    private int state;//试卷的作答状态
    private int isAssess;//本题是否可自评
    private String stuAssess;//自评/机评结果
    private String stuAnswer;//用户答案
    private int SmallQuesTotalCount;//计算小题个数
    private String answer;//正确答案
    private double score;//试题总分值
    private String analysis;//答案解析
    private String macAssess;//机评
    private int totalItemCount;//小题数量
    private int allSmallQuesItemTotalCount ;//总的空数量
    private Double correctRate;//该题准确率
    public AnswerYdjdAdapter(Context context, int sumItem, int paperID, int optionID, int modelFrom) {
        mInflater = LayoutInflater.from(context);
        this.mContext = context;
        this.SumItem = sumItem;
        this.PaperID = paperID;
        this.OptionID = optionID;
        this.ModelFrom = modelFrom;
    }

    @Override
    public int getCount() {
        return SumItem;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub

        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.adapter_answer_ydjd_item, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        /*
        * 获取作文题用户相关信息
        * */
        getInfor();

        /*
        * 显示题干信息
        * */
        showContent();

        /*
        * 写入用户作答信息
        * */
        setStuAnswer();

        /*
        * 显示用户回看解析相关信息
        */
        showAnalysis();

        return convertView;
    }


    private String[] smallQueAnswer;
    private String[] smallQuesStuAnswer;
    private String[] smallQuesAssess;
    private int smallQuesAllAmount;
    private double smallQuesScore;
    /*
    * 获取作文题用户相关信息
    * */
    private void  getInfor(){

        tvBlack = mContext.getResources().getColor(R.color.black);
        tvBlue = mContext.getResources().getColor(R.color.blue);
        tvWhite = mContext.getResources().getColor(R.color.white);
        tvGreen = mContext.getResources().getColor(R.color.green);
        tvRed = mContext.getResources().getColor(R.color.red);

        if(ModelFrom== PaperDef.FROM_BASE_REVIEW) {
            itemIndex = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforBasicReview.getPaperContent().get(PaperID).getQuesImage();
            stuAnswer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforBasicReview.getState();
            answer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforBasicReview.getPaperContent().get(PaperID).getScore();
            analysis = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforBasicReview.getPaperContent().get(PaperID).getTotalItemCount();
            correctRate = InforBasicReview.getPaperContent().get(PaperID).getCorrectRate();

            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }


            if(stuAnswer.equals("")){
                for(int i=0;i<Control.backSum(answer,"$、");i++) {
                    stuAnswer = stuAnswer + "$、";
                }
            }
            if(stuAssess.equals("")){
                for(int i=0;i<Control.backSum(answer,"$、");i++) {
                    stuAssess = stuAssess + "$、";
                }
            }
            InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAnswer(stuAnswer);
            InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAssess(stuAssess);
            Log.e("=====answer=======","===="+answer);
            Log.e("=====stuAnswer=======","===="+stuAnswer);
            Log.e("=====stuAssess=======","===="+stuAssess);


            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforBasicReview.getPaperContent().get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforBasicReview.getPaperContent().get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforBasicReview.getPaperContent().get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforBasicReview.getPaperContent().get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforBasicReview.getPaperContent().get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW){
            itemIndex = InforDifficultReview.getQueList().get(OptionID).getItemIndex();
            itemContent = InforDifficultReview.getQueList().get(OptionID).getItemContent();
            quesImage = InforDifficultReview.getQuesImage();
            stuAnswer = InforDifficultReview.getQueList().get(OptionID).getStuAnswer();
            state = InforDifficultReview.getState();
            answer = InforDifficultReview.getQueList().get(OptionID).getAnswer();
            score = InforDifficultReview.getScore();
            analysis = InforDifficultReview.getQueList().get(OptionID).getAnalysis();
            stuAssess = InforDifficultReview.getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforDifficultReview.getTotalItemCount();
            correctRate = InforDifficultReview.getCorrectRate();
            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforDifficultReview.getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforDifficultReview.getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAssess();
                }
            }
            InforDifficultReview.setStuAnswerOldAll(stuAnswerAll);
            InforDifficultReview.setStuAssessOldAll(stuAssessAll);
            InforDifficultReview.setStuAnswerNewAll(stuAnswerAll);
            InforDifficultReview.setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforDifficultReview.getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforDifficultReview.getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforDifficultReview.getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforDifficultReview.getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforDifficultReview.getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_GUESS_REVIEW){
            itemIndex = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforGuessTesting.getPaperContent().get(PaperID).getQuesImage();
            stuAnswer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforGuessTesting.getState();
            answer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforGuessTesting.getPaperContent().get(PaperID).getScore();
            analysis = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforGuessTesting.getPaperContent().get(PaperID).getTotalItemCount();
            correctRate = InforGuessTesting.getPaperContent().get(PaperID).getCorrectRate();

            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforGuessTesting.getPaperContent().get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforGuessTesting.getPaperContent().get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforGuessTesting.getPaperContent().get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforGuessTesting.getPaperContent().get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforGuessTesting.getPaperContent().get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG){
            itemIndex = InforWrongQues.get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforWrongQues.get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforWrongQues.get(PaperID).getQuesImage();
            stuAnswer = InforWrongQues.get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforWrongQues.get(PaperID).getState();
            answer = InforWrongQues.get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforWrongQues.get(PaperID).getScore();
            analysis = InforWrongQues.get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforWrongQues.get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforWrongQues.get(PaperID).getTotalItemCount();
            correctRate = InforWrongQues.get(PaperID).getCorrectRate();

            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforWrongQues.get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforWrongQues.get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforWrongQues.get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforWrongQues.get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforWrongQues.get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforWrongQues.get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforWrongQues.get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforWrongQues.get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforWrongQues.get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforWrongQues.get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG_History||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG_History){
            itemIndex = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getItemIndex();
            itemContent = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getItemContent();
            quesImage = InforHistoryWrongQues.get(PaperID).getQuesImage();
            stuAnswer = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getStuAnswer();
            state = InforHistoryWrongQues.get(PaperID).getState();
            answer = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getAnswer();
            score = InforHistoryWrongQues.get(PaperID).getScore();
            analysis = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getAnalysis();
            stuAssess = InforHistoryWrongQues.get(PaperID).getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforHistoryWrongQues.get(PaperID).getTotalItemCount();
            correctRate = InforHistoryWrongQues.get(PaperID).getCorrectRate();

            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforHistoryWrongQues.get(PaperID).getQueList().get(i).getAnswer(), "$、") + 1;
            }

            String stuAnswerAll = "";
            String stuAssessAll = "";
            for (int i = 0; i < totalItemCount; i++) {
                if(i==0){
                    stuAnswerAll = InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforHistoryWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }
            }
            InforHistoryWrongQues.get(PaperID).setStuAnswerOldAll(stuAnswerAll);
            InforHistoryWrongQues.get(PaperID).setStuAssessOldAll(stuAssessAll);
            InforHistoryWrongQues.get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforHistoryWrongQues.get(PaperID).setStuAssessNewAll(stuAssessAll);

            Log.e(">>>>>allall>>>>", "==AnswerNewAll==00==:"+ InforHistoryWrongQues.get(PaperID).getStuAnswerNewAll());
            Log.e(">>>>>allall>>>>", "==AnswerOldAll==11==:"+InforHistoryWrongQues.get(PaperID).getStuAnswerOldAll());
            Log.e(">>>>>allall>>>>", "==AssessNewAll==22==:"+InforHistoryWrongQues.get(PaperID).getStuAssessNewAll());
            Log.e(">>>>>allall>>>>", "==AssessOldAll==33==:"+InforHistoryWrongQues.get(PaperID).getStuAssessOldAll());


            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforHistoryWrongQues.get(PaperID).getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }else if(ModelFrom== PaperDef.FROM_FAVOURITE_REVIEW) {
            itemIndex = InforFavoritesPage.getQueList().get(OptionID).getItemIndex();
            itemContent = InforFavoritesPage.getQueList().get(OptionID).getItemContent();
            quesImage = InforFavoritesPage.getQuesImage();
            stuAnswer = InforFavoritesPage.getQueList().get(OptionID).getStuAnswer();
            state = InforFavoritesPage.getState();
            answer = InforFavoritesPage.getQueList().get(OptionID).getAnswer();
            score = InforFavoritesPage.getScore();
            analysis = InforFavoritesPage.getQueList().get(OptionID).getAnalysis();
            stuAssess = InforFavoritesPage.getQueList().get(OptionID).getStuAssess();
            totalItemCount = InforFavoritesPage.getTotalItemCount();
            correctRate = InforFavoritesPage.getCorrectRate();

            allSmallQuesItemTotalCount = 0;
            for(int i=0;i<totalItemCount;i++) {
                allSmallQuesItemTotalCount = allSmallQuesItemTotalCount + Control.backSum(
                        InforFavoritesPage.getQueList().get(i).getAnswer(), "$、") + 1;
            }

            SmallQuesTotalCount = Control.backSum(answer,"$、")+1;
            smallQueAnswer = new String[SmallQuesTotalCount];
            smallQuesStuAnswer = new String[SmallQuesTotalCount];
            smallQuesAssess = new String[SmallQuesTotalCount];
            Log.e(">>>>>000888>>>>AAAAA>>", "==SmallQuesTotalCount====:"+SmallQuesTotalCount);
            for(int i=0;i<SmallQuesTotalCount;i++){
                smallQueAnswer[i] = Control.returnArray(answer,"$、",2)[i];
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAnswer.equals("")){
                    smallQuesStuAnswer[i] = "";
                }else {
                    smallQuesStuAnswer[i] = Control.returnArray(stuAnswer, "$、", 2)[i];
                }
            }

            for(int i=0;i<SmallQuesTotalCount;i++){
                if(stuAssess.equals("")){
                    smallQuesAssess[i] = "";
                }else {
                    smallQuesAssess[i] = Control.returnArray(stuAssess, "$、", 2)[i];
                }
            }

            smallQuesAllAmount = 0;
            for(int i=0;i<totalItemCount;i++){
                smallQuesAllAmount = smallQuesAllAmount + Control.backSum(InforFavoritesPage.getQueList().get(i).getAnswer(),"$、")+1;
            }
            smallQuesScore = score/smallQuesAllAmount;

        }
    }

    /*
   * 获取题目题干信息
   * */
//    Handler htmlHandlerItemContent = new Handler();
    private void showContent(){

        holder.TvAnswerAmount.setText("本题包含"+totalItemCount+"个小题");

//        holder.TvItemIndex.setText("("+itemIndex+")");
        itemContent = StringEscapeUtils.unescapeXml("("+itemIndex+")"+itemContent);
        holder.TvItemContent.setText(Html.fromHtml(itemContent));
        holder.TvItemContent.setTextSize(18);

//        new Thread(new Runnable()
//        {
//            @Override
//            public void run()
//            {
//                final Spanned text = Html.fromHtml(itemContent, Control.imgGetter,null);
//                htmlHandlerItemContent.post(new Runnable()
//                {
//                    @Override
//                    public void run()
//                    {
//                        holder.TvItemContent.setText(text);
//                    }
//                });
//            }
//        }).start();

    }


    /*
    * 用户作答
    * */
    private void setStuAnswer(){
        if (state == 2 || (PaperID == 0 && ModelFrom == PaperDef.FROM_BASE_REVIEW_WRONG) ||
                (PaperID == 0 && ModelFrom == PaperDef.FROM_DIFFERENT_REVIEW_WRONG)) {
            holder.EdtAnswer.setFocusable(false);
            holder.EdtAnswer.setLongClickable(false);
        }


        holder.EdtAnswer.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                setStuAnswer(s.toString());
            }
        });
    }

    /*
 * 显示试题解析回看信息
 * */
    private void showAnalysis(){

        if(ModelFrom==PaperDef.FROM_FAVOURITE_REVIEW||
                (PaperID==1&&(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG))){

            holder.EdtAnswer.setVisibility(View.GONE);
            holder.LayoutAnalysis.setVisibility(View.GONE);
            holder.LayoutClassicExample.setVisibility(View.VISIBLE);

            holder.LayoutClassic.setVisibility(View.VISIBLE);
            answer = StringEscapeUtils.unescapeXml(answer);
            answer = answer.replace("$/","/");
            holder.TvClassicAnswer.setText(Html.fromHtml(answer));
            if(analysis.equals("")){
                holder.TvClassicAnalysis.setText("暂无解析");
            }else {
                analysis = StringEscapeUtils.unescapeXml(analysis);
                holder.TvClassicAnalysis.setText(Html.fromHtml(analysis));
            }
        }else {

            if (state == 2 || (PaperID == 0 && ModelFrom == PaperDef.FROM_BASE_REVIEW_WRONG) ||
                    (PaperID == 0 && ModelFrom == PaperDef.FROM_DIFFERENT_REVIEW_WRONG)) {
                holder.LayoutAnalysis.setVisibility(View.VISIBLE);

                holder.EdtAnswer.setVisibility(View.GONE);
                if (ModelFrom == PaperDef.FROM_GUESS_REVIEW) {
                    holder.LayoutScore.setVisibility(View.VISIBLE);
                } else {
                    holder.LayoutScore.setVisibility(View.GONE);
                }

                if(stuAnswer.equals("")){
                    stuAnswer = "系统默认纸面作答";
                    if(!stuAssess.equals("较差")) {
                        holder.TvStuAnswer.setTextColor(tvGreen);
                    }else{
                        holder.TvStuAnswer.setTextColor(tvRed);
                    }
                }else{
                    for(int i=0;i< Control.backSum(answer,"$/")+1;i++){
                        if(stuAnswer.equals(Control.returnArray(answer,"$/",2)[i])){
                            holder.TvStuAnswer.setTextColor(tvGreen);
                            break;
                        }else{
                            holder.TvStuAnswer.setTextColor(tvRed);
                        }
                    }
                }
                holder.TvStuAnswer.setText(stuAnswer);


                if (answer.equals("")) {
                    answer = "暂无参考答案";
                }else{
                    answer = answer.replace("$/","/");
                }
                answer = StringEscapeUtils.unescapeXml(answer);
                holder.TvAnswer.setText(Html.fromHtml(answer));

                double stuScore = 0;
//                if (!stuAssess.equals("")) {
//                    if (!stuAssess.equals("较差")) {
//                        if (stuAssess.equals("优秀") || stuAssess.equals("一般")) {
//                            stuScore = score * 1.0;
//                        } else {
//                            stuScore = Double.valueOf(stuAssess);
//                        }
//                    } else {
//                        stuScore = score * 0;
//                    }
//                } else {
//                    for(int i=0;i< Control.backSum(answer,"$/")+1;i++){
//                        if(stuAnswer.equals(Control.returnArray(answer,"$/",2)[i])){
//                            stuScore = score * 1.0;
//                            break;
//                        }else{
//                            holder.TvStuAnswer.setTextColor(tvRed);
//                            stuScore = score * 0;
//                        }
//                    }
//                }
                if (stuAssess.equals("优秀") || stuAssess.equals("一般")) {
                    stuScore = stuScore+smallQuesScore;
                }
                if(stuScore==0){
                    holder.TvScore.setText("0分");
                }else {
                    holder.TvScore.setText(String.valueOf(stuScore) + "分");
                }

                if (analysis.equals("")) {
                    analysis = "暂无解析";
                }
                analysis = StringEscapeUtils.unescapeXml(analysis);
                holder.TvAnalysis.setText(Html.fromHtml(analysis));

                if (stuAssess.equals("")) {
                    holder.TvStuAssess.setText("未自评");
                } else {
                    if (ModelFrom == PaperDef.FROM_GUESS_REVIEW) {
                        holder.TvStuAssess.setText(stuAssess + "分");
                    } else {
                        holder.TvStuAssess.setText(stuAssess);
                    }
                }

            } else {
                holder.EdtAnswer.setVisibility(View.VISIBLE);
                holder.LayoutAnalysis.setVisibility(View.GONE);
            }
            holder.LayoutClassicExample.setVisibility(View.GONE);
        }
    }


/*    private void showAnalysis(){

        if(stuAnswer.equals("")){
            if(state==2 ||(PaperID==0&&ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG)||(PaperID==0&&ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG)) {//显示听力原文
                if(!stuAssess.equals("")){
                    holder.EdtAnswer.setHint("已在纸面完成作答");
                }else {
                    holder.EdtAnswer.setHint("未作答");
                }
            }else{
                holder.EdtAnswer.setHint("请在这里输入答案...");
            }
        }else{
            holder.EdtAnswer.setText(stuAnswer);
        }

        if((PaperID==1&&(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG))||
                ModelFrom==PaperDef.FROM_FAVOURITE_REVIEW){
            holder.EdtAnswer.setVisibility(View.GONE);
            holder.LayoutAnalysis.setVisibility(View.GONE);
            holder.LayoutClassicExample.setVisibility(View.VISIBLE);

            holder.LayoutClassic.setVisibility(View.GONE);
            answer = StringEscapeUtils.unescapeXml(answer);
            holder.TvClassicAnswer.setText(Html.fromHtml(answer));
            if(analysis.equals("")){
                holder.TvClassicAnalysis.setText("暂无解析");
            }else {
                analysis = StringEscapeUtils.unescapeXml(analysis);
                holder.TvClassicAnalysis.setText(Html.fromHtml(analysis));
            }

        }else{

                if(state==2 ||(PaperID==0&&ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG)||(PaperID==0&&ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG)) {//显示听力原文
                    holder.LayoutAnalysis.setVisibility(View.VISIBLE);

                    if (ModelFrom == PaperDef.FROM_BASE_REVIEW || ModelFrom == PaperDef.FROM_GUESS_REVIEW) {
                        holder.LayoutScore.setVisibility(View.VISIBLE);
                    } else {
                        holder.LayoutScore.setVisibility(View.GONE);
                    }

                    if(answer.equals("")){
                        answer = "暂无参考答案";
                    }
                    answer = StringEscapeUtils.unescapeXml(answer);
                    holder.TvAnswer.setText(Html.fromHtml(answer));

                    double stuScore = 0;
                    if(!stuAssess.equals("")){
                        if(!stuAssess.equals("较差")){
                            if(stuAssess.equals("优秀")||stuAssess.equals("一般")) {
                                stuScore = score * 1.0;
                            }else{
                                stuScore = Double.valueOf(stuAssess);
                            }
                        }else{
                            stuScore = score*0;
                        }
                    }else{
                        if(stuAnswer.equals(answer)){
                            stuScore = score*1.0;
                        }else{
                            stuScore = score*0;
                        }
                    }
                    holder.TvScore.setText(String.valueOf(stuScore/totalItemCount)+"分");

                    if(analysis.equals("")){
                        analysis = "暂无解析";
                    }
                    analysis = StringEscapeUtils.unescapeXml(analysis);
                    holder.TvAnalysis.setText(Html.fromHtml(analysis));

                    if(stuAssess.equals("")){
                        holder.TvStuAssess.setText("未自评");
                    }else {
                        if(ModelFrom==PaperDef.FROM_GUESS_REVIEW) {
                            holder.TvStuAssess.setText(stuAssess+"分");
                        }else{
                            holder.TvStuAssess.setText(stuAssess);
                        }
                    }

                }else{
                    holder.LayoutAnalysis.setVisibility(View.GONE);
                }
            holder.EdtAnswer.setVisibility(View.VISIBLE);
            holder.LayoutClassicExample.setVisibility(View.GONE);
        }

    }*/

    /*
    * 写入作答信息
    * */
    private void setStuAnswer(String strStuAnswer){
        if(ModelFrom== PaperDef.FROM_BASE_REVIEW) {
            InforBasicReview.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAnswer(strStuAnswer);
            int totalItemCount = InforBasicReview.getPaperContent().get(PaperID).getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                thisAnswer = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getAnswer();
                thisStuAssess = InforBasicReview.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                if(!thisStuAssess.equals("较差")) {
                    totalItemCountTrue++;
                }
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }
            }

            InforBasicReview.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforBasicReview.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);
            InforBasicReview.getPaperContent().get(PaperID).setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforBasicReview.getPaperContent().get(PaperID).setAnsweredItemCount(quesAnsweredItemCount);

        }else if(ModelFrom==PaperDef.FROM_BASE_REVIEW_WRONG||ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW_WRONG){
            InforWrongQues.get(PaperID).getQueList().get(OptionID).setStuAnswer(strStuAnswer);
            int totalItemCount = InforWrongQues.get(PaperID).getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforWrongQues.get(PaperID).getQueList().get(i).getStuAnswer();
                thisAnswer = InforWrongQues.get(PaperID).getQueList().get(i).getAnswer();
                thisStuAssess = InforWrongQues.get(PaperID).getQueList().get(i).getStuAssess();
                if(!thisStuAssess.equals("较差")) {
                    totalItemCountTrue++;
                }
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }

            }

            InforWrongQues.get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforWrongQues.get(PaperID).setStuAssessNewAll(stuAssessAll);
            InforWrongQues.get(PaperID).setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforWrongQues.get(PaperID).setAnsweredItemCount(quesAnsweredItemCount);

        }else if(ModelFrom==PaperDef.FROM_DIFFERENT_REVIEW){

            InforDifficultReview.getQueList().get(OptionID).setStuAnswer(strStuAnswer);
            int totalItemCount = InforDifficultReview.getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforDifficultReview.getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforDifficultReview.getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforDifficultReview.getQueList().get(i).getStuAnswer();
                thisAnswer = InforDifficultReview.getQueList().get(i).getAnswer();
                thisStuAssess = InforDifficultReview.getQueList().get(i).getStuAssess();
                if(!thisStuAssess.equals("较差")) {
                    totalItemCountTrue++;
                }
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }

            }

            InforDifficultReview.setStuAnswerNewAll(stuAnswerAll);
            InforDifficultReview.setStuAssessNewAll(stuAssessAll);
            InforDifficultReview.setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforDifficultReview.setAnsweredItemCount(quesAnsweredItemCount);

        }else if(ModelFrom==PaperDef.FROM_GUESS_REVIEW){
            InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(OptionID).setStuAnswer(strStuAnswer);
            int totalItemCount = InforGuessTesting.getPaperContent().get(PaperID).getTotalItemCount();
            String stuAnswerAll = "";
            String stuAssessAll = "";
            int totalItemCountTrue = 0;
            String thisStuAnswer = "";
            String thisAnswer = "";
            String thisStuAssess = "";
            int quesAnsweredItemCount = 0;
            for(int i=0;i<totalItemCount;i++){
                if(i==0){
                    stuAnswerAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }else{
                    stuAnswerAll = stuAnswerAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                    stuAssessAll = stuAssessAll+"#$*#"+InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                }
                thisStuAnswer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAnswer();
                thisAnswer = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getAnswer();
                thisStuAssess = InforGuessTesting.getPaperContent().get(PaperID).getQueList().get(i).getStuAssess();
                if(!thisStuAssess.equals("较差")) {
                    totalItemCountTrue++;
                }
                if(!thisStuAnswer.equals("")||!thisStuAssess.equals("")){
                    quesAnsweredItemCount++;
                }

            }

            InforGuessTesting.getPaperContent().get(PaperID).setStuAnswerNewAll(stuAnswerAll);
            InforGuessTesting.getPaperContent().get(PaperID).setStuAssessNewAll(stuAssessAll);
            InforGuessTesting.getPaperContent().get(PaperID).setCorrectRate(Control.getCorrectRate(Float.valueOf(totalItemCountTrue),Float.valueOf(totalItemCount)));
            InforGuessTesting.getPaperContent().get(PaperID).setAnsweredItemCount(quesAnsweredItemCount);
        }
    }

    /*********************************************************************************************************/
    /*********************************************************************************************************/
    /**************************************************************************************************/
    /**************************************************************************************************/

    private class clickListener implements View.OnClickListener {
        public void onClick(View v) {
            if (holder.LayoutClassic.getVisibility() == GONE) {
                animationIvOpen();
                holder.LayoutClassic.setVisibility(View.VISIBLE);
            } else {
                animationIvClose();
                holder.LayoutClassic.setVisibility(View.GONE);
            }
        }
    }

    private void animationIvOpen() {
        RotateAnimation animation = new RotateAnimation(0, 180,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        animation.setFillAfter(true);
        animation.setDuration(100);
        holder.IvClassic.startAnimation(animation);
    }

    private void animationIvClose() {
        RotateAnimation animation = new RotateAnimation(180, 0,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        animation.setFillAfter(true);
        animation.setDuration(100);
        holder.IvClassic.startAnimation(animation);
    }
    /*********************************************************************************************************/
    /*********************************************************************************************************/
}